package day5;

import java.util.Scanner;

// https://www.nowcoder.com/practice/9d1559511b3849deaa71b576fa7009dc?tpId=122&tqId=33664&ru=/exam/oj
public class code1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str1 = scanner.next();
        String str2 = scanner.next();
        int count = 0;
        for (int i = 0;i <= str1.length();i++) {
            StringBuffer sb = new StringBuffer(str1);
            sb.insert(i,str2);
            StringBuffer temp = new StringBuffer(sb);
            temp.reverse();
            if(temp.toString().equals(sb.toString())){
                count++;
            }
        }
        System.out.println(count);
    }
}
